import { _decorator, Component, Label, Node } from 'cc';
import { UICtrl } from '../../../Framework/Managers/UICtrl';
const { ccclass, property } = _decorator;

@ccclass('TipDialog_Ctrl')
export class TipDialog_Ctrl extends UICtrl {
    
    winTip:Node;
    loseTip:Node;
    bossTip:Node;


    onLoad() {
        super.onLoad();
        this.winTip = this.getChildOrComponent("Win");
        this.loseTip = this.getChildOrComponent("Lose");
        this.bossTip = this.getChildOrComponent("Boss");
    }

    init(type){
        this.winTip.active = type =="win" ? true:false;
        this.loseTip.active = type =="lose" ? true:false;
        this.bossTip.active = type =="boss" ? true:false;
        this.scheduleOnce(()=>{
            this.node.destroy();
        },2);
    }

    closePage(){
        if (this.node) {
            this.node.destroy();
        }
    }
}


